<template>
	<view class="box">
		<view class="top">
			<u-navbar :is-back="true" title="兑换详情" :border-bottom="false"></u-navbar>
		</view>
		<view class="detail container_br" v-if="info">
			<view class="item flc">
				<view class="left" v-if="info.point_goods">
					<image :src="info.point_goods.images_format[0]" mode="widthFix" style="width: 160rpx;"></image>
				</view>
				<view class="right">
					<view class="name">
						{{info.point_goods.name}}
					</view>
					<view class="num">
						兑换数量:{{info.number}}
					</view>
					<view class="point">
						兑换积分{{info.pay_point}}
					</view>
				</view>
			</view>
		</view>
		<view class="userinfo container_B">
			<view class="title">
				<span v-if="info.support_express_id">已发货</span>
				<span v-else>未发货</span>
			</view>
			<view class="username flc">
				<view class="left">
					收货人:
				</view>
				<view class="right">
					{{info.contact_person}}
				</view>
			</view>
			<view class="phone flc">
				<view class="left">
					联系方式:
				</view>
				<view class="right">
					{{info.contact_phone}}
				</view>
			</view>
			<view class="time flc">
				<view class="left">
					兑换时间:
				</view>
				<view class="right">
					{{info.updated_at}}
				</view>
			</view>

			<view class="address flc">
				<view class="left">
					收货地址:
				</view>
				<view class="right">
					{{info.address}}
				</view>
			</view>
			<view class="support flc" v-if="info.support_express_id">
				<view class="left">
					快递单号
				</view>
				<view class="right">
					{{info.support_express_number}}
				</view>
			</view>
			<view class="support flc" v-if="info.support_express_id">
				<view class="left">
					快递公司
				</view>
				<view class="right">
					{{info.support_express_name}}
				</view>
			</view>
		</view>

	</view>
</template>

<script>
	import {
		myPointDetail
	} from '../../api/index';
	import baseUrl from "@/config/config.js"
	export default {
		data() {
			return {
				info: ""
			};
		},
		onLoad(res) {
			console.log(res.id);
			myPointDetail(res.id).then(res => {
				console.log(res);
				this.info = res.data
			})
		}
	}
</script>

<style lang="scss" scoped>
	.detail {
		.left{
			width: 160rpx;
			height: 160rpx;
			
		}
		.right{
			display: flex;
			flex-direction: column;
			justify-content: space-between;
			margin-left: 30rpx;
			.name{
				font-size: 34rpx;
				color: #333;
			}
			.num{
				color: #666;
				font-size: 26rpx;
			}
			.point{
				font-size: 36rpx;
				color: #f5cf36;
			}
		}
	}
	.userinfo .flc{
		margin-top: 20rpx;
		.left{
			width: 160rpx;
		}
	}
	.title{
		font-size: 40rpx;
		font-weight: 700;
	}
</style>